#pragma once

#include <linux/errno.h>
#include <linux/sched/task_types.h>
#include <linux/cpumask.h>
#include <linux/init.h>

void smp_setup_processor_id(void);
extern int __cpu_up(unsigned int cpu, struct task_struct *tidle);

#ifdef CONFIG_SMP
#include <asm/smp.h>

void smp_init(void);
#else /* !smp */
#define raw_smp_processor_id() 0

static inline void smp_init(void) {}
#endif

/*
 * Allow the architecture to differentiate between a stable and unstable read.
 * For example, x86 uses an IRQ-safe asm-volatile read for the unstable but a
 * regular asm read for the stable.
 */
#ifndef __smp_processor_id
#define __smp_processor_id() raw_smp_processor_id()
#endif

#define smp_processor_id() __smp_processor_id()

